package leetcode.秋招.美团;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author ：zsy
 * @date ：Created 2021/8/8 9:55
 * @description：
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int i = 0; i < T; i++) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] nums = new int[n];
            for (int j = 0; j < n; j++) {
                nums[j] = in.nextInt();
            }
            Arrays.sort(nums);
            if (k - 1 < nums.length && nums[k - 1] + 1 <= n) {
                System.out.println("YES");
                System.out.println(nums[k - 1] + 1);
            } else {
                System.out.println("NO");
            }
        }
    }
}
